package com.bckj.freshnow.order.mapper;

import com.bckj.freshnow.order.entity.TradeBillStatement;
import com.bckj.freshnow.order.model.TradeBillStatementResponse;
import com.bckj.freshnow.order.model.TradeBillStatementRequest;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 交易订单账单流水表(TradeBillStatement)表数据库访问层
 *
 * @author makejava
 * @since 2025-04-22 14:59:40
 */
@Mapper
public interface TradeBillStatementMapper extends BaseMapper<TradeBillStatement> {

    /**
      * 列表
      *
      * @param request req
      * @return list
      */
    @SelectProvider(method = "findAll" , type = TradeBillStatementProvider.class)
    List<TradeBillStatementResponse> findAll(TradeBillStatementRequest request);
    
    class TradeBillStatementProvider{
        
        public String findAll(TradeBillStatementRequest request){
            SQL sql = new SQL();
            sql.SELECT("id, bill_id, payment_status, statement_type, payment_method, payment_account, bill_statement_no, out_trade_no, amount, is_deleted, version, update_time, create_time");
            sql.FROM("trade_bill_statement");
            return sql.toString();
        }
    }
}

